//对日志等级进行封装
#ifndef __LEVEL_HPP__
#define __LEVEL_HPP__

namespace MyLog
{
    //日志等级类
    class LogLevel
    {
    public:
        enum class Level
        {
            UNKNOWN=0,
            DEBUG,
            INFO,
            WARNING,
            ERROR,
            FATAL,
            OFF
        };

        //获取日志等级的字符串表示
        static const char* toString(LogLevel::Level level)
        {
            switch (level)
            {
                case LogLevel::Level::DEBUG: return "DEBUG";
                case LogLevel::Level::INFO: return "INFO";
                case LogLevel::Level::WARNING: return "WARNING";
                case LogLevel::Level::ERROR: return "ERROR";
                case LogLevel::Level::FATAL: return "FATAL";
                case LogLevel::Level::OFF: return "OFF";
            }
            return "UNKNOWN";
        }
    };
}

#endif